Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / Device Communications Messages


GXOpenConnection

QuickDraw GX sends the GXOpenConnection message to establish communications with a device in preparation for sending data to it. You can override the GXOpenConnection message to open a connection with a specific device. Your override of the GXOpenConnection message must match the following formal declaration:

OSErr GXOpenConnection (void);
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
QuickDraw GX's default implementation of the GXImageJob message sends the GXOpenConnection message to prepare to send data to the device.

The default implementation of the GXOpenConnection message handles PAP, Serial, and not-connected connections. It reads the resource from the communications ('comm') resource in the desktop printer file.

You can override this message to open a connection with a specific device (such as a sheetfeeder) or to perform status checks at the time the device is opened. If you perform a status check and a failure occurs at that time, you must call the GXCleanupOpenConnection function.

Note
The default implementation of this message does not support SCSI devices.
SPECIAL CONSIDERATIONS
You never send the GXOpenConnection message yourself.

If you are implementing a nonsupported type of communications connection, you need to perform a total override of the GXOpenConnection message. Otherwise, you need to first forward the message and then perform status checking on the device.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
The default implementation of the GXOpenConnection message can also return the communications errors that are listed in Table 4-2 on page 4-42.

SEE ALSO
The GXImageJob message is described on page 4-90.

You can find an example of an override of the GXOpenConnection message in
Listing 3-8 on page 3-30 in the chapter "Printer Drivers."

The GXCleanupOpenConnection function is described on page 5-36 in the chapter "Printing Functions for Message Overrides."

The communications ('comm') resource is described in the section "The Communications ('comm') Resource" beginning on page 6-36 in the chapter "Printing Resources."


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help